<?php $this->load->view('admin/common/header'); ?>
<?php $this->load->view('admin/common/menu'); ?>

<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" media="screen" href="<?php echo base_url(); ?>themes/default/css/redmond/jquery-ui-1.8.20.custom.css" />
<link rel="stylesheet" type="text/css" media="screen" href="<?php echo base_url(); ?>themes/default/css/ui.jqgrid.css" />
<link rel="stylesheet" type="text/css" media="screen" href="<?php echo base_url(); ?>themes/default/css/ui.multiselect.css" />
<link rel="stylesheet" type="text/css" media="screen" href="<?php echo base_url(); ?>themes/default/css/regForm.css" />
<link rel="stylesheet" type="text/css" media="screen" href="<?php echo base_url(); ?>themes/default/css/cmxform.css" />

<script language="javascript" src="<?php echo base_url(); ?>themes/default/javascript/jquery-1.7.2.js"></script>
<script language="javascript" src="<?php echo base_url(); ?>themes/default/javascript/i18n/ui.multiselect.js"></script>
<script language="javascript" src="<?php echo base_url(); ?>themes/default/javascript/i18n/grid.locale-en.js"></script>
<script language="javascript" src="<?php echo base_url(); ?>themes/default/javascript/jquery.layout.js" type="text/javascript"></script>
<script language="javascript" src="<?php echo base_url(); ?>themes/default/javascript/jquery.jqGrid.min.js" type="text/javascript"></script>
<script language="javascript" src="<?php echo base_url(); ?>themes/default/javascript/jquery-ui-1.8.18.custom.min.js" type="text/javascript"></script>

</head>
<body>
<form action="/DemoPhp/user/register" method="post">
<div> <label>User Name:</label>
	<input type='text' value='' id='userName' name='userName'/>
</div>
<div>
<?php echo validation_errors();?>
</div>
<div><input type="submit" value='ok man' /></div>
</form>

<table id="list1"></table> <div id="pager1"></div> 
<script>
function enterPressed(evt)
{
	var charCode = (evt.which) ? evt.which : event.keyCode;
	 if (charCode == 13) //Khong xu ly
	 {
		 return false;
	 }//Enter
}
jQuery().ready(function (){
	jQuery("#list1").jqGrid({
	   	url:'http://localhost/DemoPhp/user/getit',
	   	datatype: "json",
	   	colNames:["Id",
		   		  "<?php echo $this->lang->line('username_list'); ?>", 
		   		  "<?php echo $this->lang->line('fullname_list'); ?>",
		   	      "<?php echo $this->lang->line('email_list'); ?>",
		   	      "<?php echo $this->lang->line('group_list'); ?>",
			   	  "<?php echo $this->lang->line('status_list'); ?>",
			   	  "<?php echo $this->lang->line('regisdate_list'); ?>"],
	   	colModel:[
	   		{name:'id',index:'id', width:75},
	   		{name:'invdate',index:'invdate', width:90},
	   		{name:'name',index:'name', width:100},
	   		{name:'amount',index:'amount', width:80, align:"right"},
	   		{name:'tax',index:'tax', width:80, align:"right"},		
	   		{name:'total',index:'total', width:80,align:"right"},		
	   		{name:'note',index:'note', width:150, sortable:false}		
	   	],
	   	rowNum:10,
	   	autowidth: true,
	   	rowList:[10,20,30],
	   	pager: jQuery('#pager1'),
	   	sortname: 'id',
	    viewrecords: true,
	    sortorder: "desc",
	    caption:"XML Example"
	}).navGrid('#pager1',{edit:false,add:false,del:false});

	$( "#display" )//Hien thi chi tiet
	.button()
	.click(function() 
	{
		/*-----------------------------------------*/
		jQuery( "#dlg_edit" ).dialog({
			autoOpen: true,
			height: 350,
			width: 750,
			modal: true,
			close: function(ev, ui) 
			{ 		
				
	        },
			buttons: {
				Exit: { text:'Thoát',
					 click:function() {
					 	$( this ).dialog( "close" );	
					}	
				},
				OK:{text:'Thêm mới',
					click:function() {
						authenticate('Nguyen','Ducthang');

						
					}	
			    }
			  }
		});

		/*-----------------------------------------*/
	});
});

function authenticate(userName, password) {
	var jsonObjects = [{id:1, name:"amit"}, {id:2, name:"ankit"},{id:3, name:"atin"},{id:1, name:"puneet"}];

    $.ajax
    ({
        type: "POST",
        //the url where you want to sent the userName and password to
        url: '<?php echo base_url(); ?>user/add',
        dataType: 'json',
        async: false,
        //json object to sent to the authentication url
        data: jQuery.parseJSON('{"userName":"'+ userName+'","password":"'+password +'"}'),
        success: function (xml) {
        	alert(xml); 
        }
    });
}

</script>
 <button id="display" name="display" style="float:left;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Xem&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</button>
 
<div id="dlg_edit" style="display:none; padding:5px;" title='Sua form'>
  <div class="form-container-dialog ui-helper-clearfix  ui-corner-all">
	<form>
	<table width='730px'>
		<tr>
			<td align="left" valign="top"  width="50%" >
			<div class="form-panel-auto-dialog">
  			  <fieldset class="ui-corner-all" >
				<table width="100%" >
					<tr>
						<td align="left" valign="top" width="150px"><label for="id_edit" style='width:150px;'>Id:</label></td>
						<td align="left" valign="top" width="350px">	
							<input type="hidden" name="id" id="id"  class="text ui-widget-content ui-corner-all" maxlength="10" size="0" />			
							<input type="text" name="id_edit" onkeydown="javascript:return enterPressed(event);" id="id_edit" readonly class="text ui-widget-content ui-corner-all" maxlength="20" size="10"  style="border: 1px solid red !important; background: #FFF37B !important;"/>
						</td>
					</tr>
					<tr>
						<td align="left" valign="top"><label for="userName_edit" style="float:left;">Tài khoản:</label></td>
						<td align="left" valign="top">				
							<input type="text" name="userName_edit" style="float:left;background:#D9EDFF"  readonly="readonly" onkeydown="javascript:return enterPressed(event);" id="userName_edit" readonly class="text ui-widget-content ui-corner-all" maxlength="10" size="10"/>
							<font color="#FF0000" style='float:left;'>*</font>
							
							<div  style="width:50px;float:left;margin-left:5px;">
								<button id='search_customer'  name='search_customer'>...</button>
							</div>
						</td>
					</tr>
					<tr>
						<td align="left" valign="top"><label for="password_edit">Mật khẩu:</label></td>
						<td align="left" valign="top">				
							<input type="text" name="password_edit" style='background:#D9EDFF'  onkeydown="javascript:return enterPressed(event);" id="password_edit" readonly class="text ui-widget-content ui-corner-all" maxlength="10" size="10"/>
						</td>
					</tr>
					<tr>
						<td align="left" valign="top" width="120px"><label style="float:left;width:120px" for="confirmPassword_edit" >Xác nhận mật khẩu:</label></td>
						<td>
							<input  onkeydown="javascript:return displayKeyCode(event,this)" style="float:left;background:#D9EDFF"  onkeypress="javascript:return true;"  type="text" name="confirmPassword_edit" id="confirmPassword_edit" class="text ui-widget-content ui-corner-all" maxlength="200"  size="25" />
							<span class='yeucau'>*</span>
						</td>
					</tr>
					<tr>
						<td align="left" valign="top" width="120px"><label style="float:left;width:120px" for="email_edit" >Email:</label></td>
						<td>
							<input  onkeydown="javascript:return displayKeyCode(event,this)" style="float:left;background:#D9EDFF"  onkeypress="javascript:return true;"  type="text" name="email_edit" id="email_edit" class="text ui-widget-content ui-corner-all" maxlength="200"  size="25" />
							<span style="color:red;float:left;width:auto;">*</span>
						</td>
					</tr>
					<tr>
						<td align="left" valign="top"><label for="confirmEmail_edit">Chiều giao dịch:</label></td>
						<td align="left" valign="top">
							<input  onkeydown="javascript:return displayKeyCode(event,this)" style="float:left;background:#D9EDFF"  onkeypress="javascript:return true;"  type="text" name="confirmEmail_edit" id="confirmEmail_edit" class="text ui-widget-content ui-corner-all" maxlength="200"  size="25" />
						<span class='yeucau'>*</span>
						</td>
					</tr>
					<tr>
						<td align="left" valign="top"><label for="fullName_edit">Họ tên:</label></td>
						<td align="left" valign="top">
						 	<input  onkeydown="javascript:return displayKeyCode(event,this)" style="float:left;background:#D9EDFF"  onkeypress="javascript:return true;"  type="text" name="fullName_edit" id="fullName_edit" class="text ui-widget-content ui-corner-all" maxlength="200"  size="25" />
					      	<span class='yeucau'>*</span>
					</tr>
					<tr>
						<td align="left" valign="top" width="120px"><label style="float:left;width:120px" for="birthday_edit" >Ngày sinh:</label></td>
						<td>
							<input  onkeydown="javascript:return displayKeyCode(event,this)" style="float:left;background:#D9EDFF"  onkeypress="javascript:return true;"  type="text" name="birthday_edit" id="birthday_edit" class="text ui-widget-content ui-corner-all" maxlength="200"  size="25" />
					      	<span class='yeucau'>*</span>
						</td>
					</tr>
				</table>
				</fieldset>
			  </div>
			</td>
			<td align="left" valign="top" width="50%">
			<div class="form-panel-auto-dialog">
  			  <fieldset class="ui-corner-all" >
				<table>
				
					<tr>
						<td align="left" valign="top" width="150px"><label style="width:150px" for="gender_edit">Giới tính:</label></td>
						<td>
							<select name="gender_edit" id="gender_edit" style="width:100px;" >
								<option value="0">Nam</option>
								<option value="1">Nữ</option>
					      	</select>
					      	<span class='yeucau'>*</span>
						</td>
					</tr>
					<tr>
						<td align="left" valign="top"><label for="address_edit">Địa chỉ:</label></td>
						<td align="left" valign="top"><input type="text" name="address_edit" id="address_edit" style="float:left;" class="text ui-widget-content ui-corner-all" maxlength="10"  size="10" onkeydown="javascript:return displayKeyCode(event,this)"  onkeypress="javascript:return true;" />
							<span style="color:red;float:left;width:auto;">*</span>
						</td>
						
					</tr>
					
					<tr>
						<td align="left" valign="top" width="120px"><label style="float:left;width:120px" for="city_edit" >Tỉnh/Thành phố:</label></td>
						<td>
							<input  type="text" name="city_edit" id="city_edit" style="float:left;" class="text ui-widget-content ui-corner-all" maxlength="10"  size="10"/>
							<span style="color:red;float:left;width:auto;">*</span>
						</td>
					</tr>

					<tr>
						<td align="left" valign="top" width="120px">
							<label style="float:left;width:120px" for="tel_edit" >Điện thoại:</label>
						</td>
						<td>
							<input type="text" style="float:left;" name="tel_edit" id="tel_edit" class="text ui-widget-content ui-corner-all" maxlength="10"  size="10"/>
							<span style="color:red;float:left;width:auto;">*</span>
						</td>
					</tr>
					<tr>
						<td align="left" valign="top" width="120px">
							<label style="float:left;width:120px" for="mobil_edit" >Mobile:</label>
						</td>
						<td>
							<input type="text" style="float:left;" name="mobil_edit" id="mobil_edit" class="text ui-widget-content ui-corner-all" maxlength="10"  size="10"/>
							<span style="color:red;float:left;width:auto;">*</span>
						</td>
					</tr>	
					<tr>
						<td align="left" valign="top"><label for="sky_edit">Nick Sky:</label></td>
						<td align="left" valign="top"><input type="text" style="text-align:right;float:left;"  id='sky_edit' name='sky_edit' class="text ui-widget-content ui-corner-all">
						<font color="#FF0000" style='float:left;'>*</font>
						</td>
					</tr>
					<tr>
						<td align="left" valign="top"><label for="yahoo_edit">Nick Yahoo:</label></td>
						<td align="left" valign="top" ><input type="text" style='text-align:right;float:left;' name="yahoo_edit"  id="yahoo_edit" class="text ui-widget-content ui-corner-all"><font color="#FF0000" style='float:left;'>*</font></td>
					</tr>
					
					<tr>
						<td align="left" valign="top"><label for="capcha_edit">Mã Xác Thực:</label></td>
							<td align="left" valign="top"><input type="text" id='capcha_edit' name='capcha_edit' style="text-align:right;color:red;" class="text ui-widget-content ui-corner-all">
						</td>
					</tr>
					
				</table>
			</fieldset>
			</div>
			</td>
		</tr>
	</table>	
	</form>
</div>
</div>
</body>
</html>
<?php $this->load->view('admin/common/footer'); ?>